import request from '@/utils/request'
//获取状态不是"未结束"赛事列表
export const getAllList= () => {
    return request.get('/user/getAllList')
}
//获取用户个人信息
export const getUserInfor = (userId) => {
    return request.get(`/user/getUserInfor/${userId}`)
}
//修改个人信息
export const updateUserInfor = (data) => {
    return request.post('/user/updateUserInfor',data)
}
//获取验证码
export const sendVerificationEmail = (email) => {
    return request.post('/code/sendCode',{email},{ timeout: 10000 })
}
//修改密码
export const updateUserPass = (infor) => {
    return request.post('/user/updatePassword',infor,{
        headers: {
            'Content-Type': 'application/json'
        }
    })
}

//报名为运动员
export const insertCom = (item,userId) => {
    return request.post(`/user/insertCom/${userId}`,item)
}

//获取参赛人员名单
export const getUserList = (projectId) => {
    return request.get(`/user/getUserList/${projectId}`)
}
//申请为裁判员
export const insertRef = (item,userId) => {
    return request.post(`/user/insertRef/${userId}`,item)
}

//添加队伍
export const addTeam = (userId,teamForm) => {
    return request.post(`/user/addTeam/${userId}`,teamForm)
}

//获取团队列表
export const getTeamList = (projectId) => {
    return request.get(`/user/getTeamList/${projectId}`)
}

//加入队伍
export const joinTeam = (userId,infor) => {
    return request.post(`/user/joinTeam/${userId}`,infor)
}

//获取所有状态的赛事
export const getAllLists = () => {
    return request.get('/user/getAllLists')
}

//获取个人参加的比赛
export const getMymatchInfor = (userId) => {
    return request.get(`/user/getMymatchInfor/${userId}`)
}

//获取个人赛所有项目
export const getArrangement= (type) => {
    return request.get(`/user/getArrangement/${type}`)
}

//获取报名为裁判的比赛
export const getRefereeCom = (userId) => {
    return request.get(`/user/getRefereeCom/${userId}`)
}

//个人赛打分
export const submitGerenScore = (projectId,scoreData) => {
    return request.post(`/user/submitGerenScore/${projectId}`,scoreData)
}

//获取参赛队伍
export const getScoreTeamList = (projectId) => {
    return request.get(`/user/getScoreTeamList/${projectId}`)
}

//团队赛打分
export const submitTeamScore = (projectId,scoreData) => {
    return request.post(`/user/submitTeamScore/${projectId}`,scoreData)
}

//获取个人排名
export const getRanking = (projectId) => {
    return request.get(`/user/getRanking/${projectId}`)
}

//获取团队排名
export const getTeamRanking = (projectId) => {
    return request.get(`/user/getTeamRanking/${projectId}`)
}